package com.hesicare.adapter.controller;

import com.hesicare.adapter.worker.HisWorkManagers;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author 55097
 */
@Controller
public class JobsController {

    @Autowired
    private HisWorkManagers hisWorkManagers;

    protected final static Logger log = LoggerFactory.getLogger(JobsController.class);

    /**
     * 同步his患者
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doPatient")
    public ReturnT<String> doPatient(String param) {
        ReturnT<String> returnT = new ReturnT<>();
        return hisWorkManagers.getPatient(returnT, param);
    }

    /**
     * 同步his出院患者
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doOutPatient")
    public ReturnT<String> doOutPatient(String param) {
        ReturnT<String> returnT = new ReturnT<>();
        return hisWorkManagers.getOutPatient(returnT, param);
    }

    /**
     * 同步his员工
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doUser")
    public ReturnT<String> doUser(String param) {
        ReturnT<String> returnT = new ReturnT<>(param);
        return hisWorkManagers.getStaff(returnT, param);
    }

    /**
     * 同步his机构
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doDept")
    public ReturnT<String> doDept(String param) {
        ReturnT<String> returnT = new ReturnT<>(param);
        return hisWorkManagers.getDept(returnT, param);
    }

    /**
     * 同步his医嘱
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doAdvice")
    public ReturnT<String> doAdvice(String param) {
        ReturnT<String> returnT = new ReturnT<>();
        return hisWorkManagers.getOther(returnT, param);
    }

    /**
     * 回传血糖数据
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doRecv")
    public ReturnT<String> doRecv(String param) {
        ReturnT<String> returnT = new ReturnT<>();
        return hisWorkManagers.getRecv(returnT, param);
    }

    /**
     * 同步his实验室检验检查数据
     *
     * @param:
     * @return:
     * @author: 55097
     * @date: 2021/12/8
     */
    @XxlJob("doIndicator")
    public ReturnT<String> doIndicator(String param) {
        ReturnT<String> returnT = new ReturnT<>();
        return hisWorkManagers.getIndicator(returnT, param);
    }

}
